<?php
/**
 * 员工
 * 
 * Created	: 2011-05-20
 * Modified : 2011-05-20
 * @author  : 陈立强
 */
class SStaff extends Staff 
{
	
	/**
	 * 获取一个制造类型的员工信息
	 * @param int $uid
	 * @param int $class
	 */
	public static function getInfo($uid, $class)
	{
		$info = parent::getInfo($uid, $class);
		if (!$info) {
			return array(
				'val' => false,
				'msg' => $L['Failure_Read']
			);
		} else {
			return array(
				'val' => true,
				'data' => $info
			);
		}
	}
	
	/**
	 * 获取一个制造类型的员工信息
	 * @param int $uid
	 * @param int $staff_id
	 */
	public static function getInfoById($uid, $staff_id)
	{
		$info = parent::getInfoById($uid, $staff_id);
		if (!$info) {
			return array(
				'val' => false,
				'msg' => $L['Failure_Read']
			);
		} else {
			return array(
				'val' => true,
				'data' => $info
			);
		}
	}
	
	/**
	 * 获取一个制造类型的员工能力值数据
	 * @param int $uid
	 * @param int $class
	 * @param int $abi_id
	 * @return array
	 */
	public static function getData($uid, $class, $abi_id=null)
	{
		$info = parent::getData($uid, $class, $abi_id);
		if (!$info) {
			return array(
				'val' => false,
				'msg' => $L['Failure_Read']
			);
		} else {
			return array(
				'val' => true,
				'data' => $info
			);
		}
	}
	
	/**
	 * 获取员工能力值数据
	 * @param int $uid
	 * @param int $class
	 * @param int $abi_id
	 * @return array
	 */
	public static function getDataById($uid, $staff_id, $abi_id=null)
	{
		$info = parent::getDataById($uid, $staff_id, $abi_id);
		if (!$info) {
			return array(
				'val' => false,
				'msg' => $L['Failure_Read']
			);
		} else {
			return array(
				'val' => true,
				'data' => $info
			);
		}
	}
	
	
	/**
	 * 获取PK详细记录列表
	 * @param int $uid
	 * @param int $staff_id
	 */
	public static function getPkLogList($uid, $staff_id)
	{
		global $L;
		$list = parent::getPkLogList($uid, $staff_id);
		if ($list === false) {
			return array(
				'val' => false,
				'msg' => $L['Failure_Read']
			);
		} else {
			return array(
				'val' => true,
				'data' => $list
			);
		}
	}
	
	/**
	 * 获取PK与被PK列表
	 * @param int $uid
	 * @param int $staff_id
	 */
	public static function getPkMessage($uid, $class=null)
	{
		global $L;
		$list = parent::getPkMessage($uid, $class);
		if (!$list && !is_array($list)) {
			return array(
				'val' => false,
				'msg' => $L['Failure_Read']
			);
		} else {
			return array(
				'val' => true,
				'data' => $list
			);
		}
	}
	
	/**
	 * 获取PK奖励
	 * @param int $uid
	 * @param int $spl_id
	 */
	public static function getPkResultInfo($uid, $spl_id)
	{
		$info = parent::getPkResultInfo($uid, $spl_id);
		if ($info === false) {
			return array(
				'val' => false,
				'msg' => $L['invalid_request']
			);
		} elseif (!$info) {
			return array(
				'val' => false,
				'msg' => $L['Failure_Read']
			);
		} else {
			return array(
				'val' => true,
				'data' => $info
			);
		}
	}
}